﻿name: dotnet package

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Setup .NET 8.x
        uses: actions/setup-dotnet@v3
        with:
          dotnet-version: '8.x'

      - name: Display dotnet version
        run: dotnet --version

      - uses: actions/cache@v3
        with:
          path: ~/.nuget/packages
          # Look to see if there is a cache hit for the corresponding requirements file
          key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
          restore-keys: |
            ${{ runner.os }}-nuget

      - name: Install dependencies
        run: dotnet restore

      - name: Build
        run: dotnet build

      - name: Test with the dotnet CLI
        run: dotnet test